/// Bynow dart does not support reference parameter.
/// This is a alternative option at this moment.
/// A helper class to emulate reference parameters in Dart.
///
/// Usage:
/// ```dart
/// final counter = Ref(get: () => _counter, set: (v) => _counter = v);
/// counter.value++; // updates the original _counter
/// ```
class Ref<T> {
  Ref({required this.get, this.set});

  final T Function() get;
  final void Function(T)? set;

  T get value => get();

  set value(T value) {
    set?.call(value);
  }
}
